/* This file is part of FireEscape.
 *
 * FireEscape is the intellectual work of Phillip Cheng & Allen Park.
 * All future releases or modifications of this program must include this
 * attribuation as according to the Creative Commons BY-SA license.
 *
 * FireEscape is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * FireEscape is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with FireEscape.  If not, see <http://www.gnu.org/licenses/>.
 *
 * All modifications to this program should include this original statement.
 *
 * If you modify, distribute, or use the program , please contact
 * fireescape@kloudvine.com
 * http://code.google.com/p/fireescape/
 *
 * If you are interested in using FireEscape for your structure, please contact us
 * for support.
 *
 * If you do use FireEscape, please consider donating to the project.
 */

package fireescape;

import java.io.Serializable;
import java.util.List;

/**
 * Represents a genome that is a set of routes
 * @author drtechmaster
 */
public class Genome implements Serializable {

    private List route;
    private boolean iterated;
    private double time;
    private int motherHash = 0;
    private int fatherHash = 0;
    private double motherTime;
    private double fatherTime;
    private int myHash = 0;
    private int genomeID;

    /**
     * Constructs the genome
     * @param hash The hash of the genome
     * @param route The 
     * @param time
     * @param iterated
     * @param genomeID
     */
    public Genome(int hash, List route, double time, boolean iterated, int genomeID) {
        this.route = route;
        this.time = time;
        this.iterated = iterated;
        this.myHash = hash;
        this.genomeID = genomeID;
    }

    /**
     * Sets the mother hash
     * @param motherHash The new mother hash
     */
    public void setMotherHash(int motherHash) {
        this.motherHash = motherHash;
    }

    /**
     * Sets the father has
     * @param fatherHash The new father hash
     */
    public void setFatherHash(int fatherHash) {
        this.fatherHash = fatherHash;
    }

    /**
     * Returns the mother hash
     * @return The mother hash
     */
    public int getMotherHash() {
        return motherHash;
    }

    /**
     * Returns the father hash
     * @return The father hash
     */
    public int getFatherHash() {
        return fatherHash;
    }

    /**
     * Returns the current hash
     * @return The current hash
     */
    public int getHash() {
        return myHash;
    }

    /**
     * Returns the genome ID
     * @return The genome ID
     */
    public int getGenomeID() {
        return genomeID;
    }

    /**
     * Sets the mother time
     * @param motherTime The new mother time
     */
    public void setMotherTime(double motherTime) {
        this.motherTime = motherTime;
    }

    /**
     * Sets the father time
     * @param fatherTime The new father time
     */
    public void setFatherTime(double fatherTime) {
        this.fatherTime = fatherTime;
    }

    /**
     * Returns the mother time
     * @return The mother time
     */
    public double getMotherTime() {
        return motherTime;
    }

    /**
     * Returns the father time
     * @return The father time
     */
    public double getFatherTime() {
        return fatherTime;
    }

    /**
     * Returns the routes used in the genome
     * @return The routes used in the genome
     */
    public List getList() {
        return route;
    }

    /**
     * Returns if this genome has iterated or not
     * @return True if the genome has iterated, false if not
     */
    public boolean iterated() {
        return iterated;
    }

    /**
     * Returns the time of the current routes
     * @return The time of the current routes
     */
    public double getTime() {
        return time;
    }
}